import { generate } from "./generate";
import { parserHTML } from "./parser";



export function compileToFunction(template) {
  // 1.将模板变成ast语法树
  let ast = parserHTML(template);

  // 2.将ast生成代码

  let code = generate(ast);
  debugger;
  let render = new Function(`with(this){return ${code}}`)
  debugger
  return render;


}